/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_QUALIF_MEIO_TRANSMISSAO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "QualifMeioTransmissao.findAll", query = "SELECT q FROM QualifMeioTransmissao q"),
    @NamedQuery(name = "QualifMeioTransmissao.findByQmtId", query = "SELECT q FROM QualifMeioTransmissao q WHERE q.qmtId = :qmtId"),
    @NamedQuery(name = "QualifMeioTransmissao.findByQmtNm", query = "SELECT q FROM QualifMeioTransmissao q WHERE q.qmtNm = :qmtNm"),
    @NamedQuery(name = "QualifMeioTransmissao.findByQmtDs", query = "SELECT q FROM QualifMeioTransmissao q WHERE q.qmtDs = :qmtDs")})
public class QualifMeioTransmissao implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "QMT_ID")
    private BigDecimal qmtId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "QMT_NM")
    private String qmtNm;
    @Size(max = 4000)
    @Column(name = "QMT_DS")
    private String qmtDs;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tmtQmtId")
    private List<TipoMeioTransmissao> tipoMeioTransmissaoList;

    public QualifMeioTransmissao() {
    }

    public QualifMeioTransmissao(BigDecimal qmtId) {
        this.qmtId = qmtId;
    }

    public QualifMeioTransmissao(BigDecimal qmtId, String qmtNm) {
        this.qmtId = qmtId;
        this.qmtNm = qmtNm;
    }

    public BigDecimal getQmtId() {
        return qmtId;
    }

    public void setQmtId(BigDecimal qmtId) {
        this.qmtId = qmtId;
    }

    public String getQmtNm() {
        return qmtNm;
    }

    public void setQmtNm(String qmtNm) {
        this.qmtNm = qmtNm;
    }

    public String getQmtDs() {
        return qmtDs;
    }

    public void setQmtDs(String qmtDs) {
        this.qmtDs = qmtDs;
    }

    @XmlTransient
    public List<TipoMeioTransmissao> getTipoMeioTransmissaoList() {
        return tipoMeioTransmissaoList;
    }

    public void setTipoMeioTransmissaoList(List<TipoMeioTransmissao> tipoMeioTransmissaoList) {
        this.tipoMeioTransmissaoList = tipoMeioTransmissaoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (qmtId != null ? qmtId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof QualifMeioTransmissao)) {
            return false;
        }
        QualifMeioTransmissao other = (QualifMeioTransmissao) object;
        if ((this.qmtId == null && other.qmtId != null) || (this.qmtId != null && !this.qmtId.equals(other.qmtId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.QualifMeioTransmissao[ qmtId=" + qmtId + " ]";
    }
    
}
